home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / Mesa-1.2.1 / include / GL / glu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-05  |  8.7 KB  |  384 lines

  1. /* glu.h */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25. $Id: glu.h,v 1.11 1995/05/30 13:13:03 brianp Exp $
  26.  
  27. $Log: glu.h,v $
  28.  * Revision 1.11  1995/05/30  13:13:03  brianp
  29.  * added GLU_TRUE, GLU_FALSE, GLU_NURBS_ERRORxx, etc.
  30.  *
  31.  * Revision 1.10  1995/05/29  20:08:38  brianp
  32.  * added gluGetNurbsProperty() prototype
  33.  *
  34.  * Revision 1.9  1995/05/24  13:43:30  brianp
  35.  * added gluBeginTrim, gluEndTrim, gluPwlCurve
  36.  *
  37.  * Revision 1.8  1995/05/22  17:03:21  brianp
  38.  * Release 1.2
  39.  *
  40.  * Revision 1.7  1995/05/16  18:03:22  brianp
  41.  * renamed GLU_EDGEFLAG to GLU_EDGE_FLAG
  42.  * renamed quadric, triangulator and nurbs structs
  43.  *
  44.  * Revision 1.6  1995/04/28  20:04:57  brianp
  45.  * added stuff for Bogdan Sikorski's polygon tesselator
  46.  *
  47.  * Revision 1.5  1995/04/28  14:50:50  brianp
  48.  * moved structs to their respective .c files
  49.  *
  50.  * Revision 1.4  1995/04/18  15:50:19  brianp
  51.  * changed GLenum arguments to GLUenum, added ErrorFunc to quadric object
  52.  *
  53.  * Revision 1.3  1995/04/17  14:41:26  brianp
  54.  * added GLU version 1.1 function: gluGetString
  55.  *
  56.  * Revision 1.2  1995/03/04  19:45:47  brianp
  57.  * 1.1 beta revision
  58.  *
  59.  * Revision 1.1  1995/02/28  21:21:03  brianp
  60.  * Initial revision
  61.  *
  62.  */
  63.  
  64.  
  65. #ifndef GLU_H
  66. #define GLU_H
  67.  
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72.  
  73.  
  74. #include "GL/gl.h"
  75.  
  76.  
  77. #define GLU_VERSION_1_1
  78.  
  79.  
  80. #define GLU_TRUE   GL_TRUE
  81. #define GLU_FALSE  GL_FALSE
  82.  
  83.  
  84. typedef enum {
  85.     /* Quadric draw styles */
  86.     GLU_FILL,
  87.     GLU_LINE,
  88.     GLU_SILHOUETTE,
  89.     GLU_POINT,
  90.     GLU_OUTLINE_PATCH,
  91.     GLU_OUTLINE_POLYGON,
  92.  
  93.     /* Quadric orientation */
  94.     GLU_OUTSIDE,
  95.     GLU_INSIDE,
  96.  
  97.     /* Normal vectors */
  98.     GLU_NONE,
  99.     GLU_FLAT,
  100.     GLU_SMOOTH,
  101.  
  102.     /* NURBS */
  103.     GLU_SAMPLING_TOLERANCE,
  104.     GLU_DISPLAY_MODE,
  105.     GLU_CULLING,
  106.     GLU_AUTO_LOAD_MATRIX,
  107.     GLU_MAP1_TRIM_2,
  108.     GLU_MAP1_TRIM_3,
  109.  
  110.     /* Tesselator */
  111.     GLU_BEGIN,
  112.     GLU_VERTEX,
  113.     GLU_EDGE_FLAG,
  114.     GLU_END,
  115.     GLU_EXTERIOR,
  116.     GLU_INTERIOR,
  117.     GLU_CCW,
  118.     GLU_CW,
  119.     GLU_UNKNOWN,
  120.  
  121.     /* New in GLU 1.1 */
  122.     GLU_EXTENSIONS,
  123.     GLU_VERSION,
  124.  
  125.     /* Errors */
  126.     GLU_INVALID_ENUM,
  127.     GLU_INVALID_VALUE,
  128.     GLU_OUT_OF_MEMORY,
  129.     GLU_ERROR,
  130.     GLU_NO_ERROR,
  131.     GLU_TESS_ERROR1,    /* missing gluEndPolygon */
  132.     GLU_TESS_ERROR2,    /* missing gluBeginPolygon */
  133.     GLU_TESS_ERROR3,    /* misoriented contour */
  134.     GLU_TESS_ERROR4,    /* vertex/edge intersection */
  135.     GLU_TESS_ERROR5,    /* misoriented or self-intersecting loops */
  136.     GLU_TESS_ERROR6,    /* coincident vertices */
  137.     GLU_TESS_ERROR7,    /* all vertices collinear */
  138.     GLU_TESS_ERROR8,    /* intersecting edges */
  139.     GLU_TESS_ERROR9,    /* not coplanar contours */
  140.     GLU_NURBS_ERROR1,
  141.     GLU_NURBS_ERROR2,
  142.     GLU_NURBS_ERROR3,
  143.     GLU_NURBS_ERROR4,
  144.     GLU_NURBS_ERROR5,
  145.     GLU_NURBS_ERROR6,
  146.     GLU_NURBS_ERROR7,
  147.     GLU_NURBS_ERROR8,
  148.     GLU_NURBS_ERROR9,
  149.     GLU_NURBS_ERROR10,
  150.     GLU_NURBS_ERROR11,
  151.     GLU_NURBS_ERROR12,
  152.     GLU_NURBS_ERROR13,
  153.     GLU_NURBS_ERROR14,
  154.     GLU_NURBS_ERROR15,
  155.     GLU_NURBS_ERROR16,
  156.     GLU_NURBS_ERROR17,
  157.     GLU_NURBS_ERROR18,
  158.     GLU_NURBS_ERROR19,
  159.     GLU_NURBS_ERROR20,
  160.     GLU_NURBS_ERROR21,
  161.     GLU_NURBS_ERROR22,
  162.     GLU_NURBS_ERROR23,
  163.     GLU_NURBS_ERROR24,
  164.     GLU_NURBS_ERROR25,
  165.     GLU_NURBS_ERROR26,
  166.     GLU_NURBS_ERROR27,
  167.     GLU_NURBS_ERROR28,
  168.     GLU_NURBS_ERROR29,
  169.     GLU_NURBS_ERROR30,
  170.     GLU_NURBS_ERROR31,
  171.     GLU_NURBS_ERROR32,
  172.     GLU_NURBS_ERROR33,
  173.     GLU_NURBS_ERROR34,
  174.     GLU_NURBS_ERROR35,
  175.     GLU_NURBS_ERROR36,
  176.     GLU_NURBS_ERROR37
  177. } GLUenum;
  178.  
  179.  
  180. typedef struct GLUquadricObj GLUquadricObj;
  181.  
  182. typedef struct GLUtriangulatorObj GLUtriangulatorObj;
  183.  
  184. typedef struct GLUnurbsObj GLUnurbsObj;
  185.  
  186.  
  187.  
  188. /*
  189.  *
  190.  * Miscellaneous functions
  191.  *
  192.  */
  193.  
  194. extern void gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez,
  195.                GLdouble centerx, GLdouble centery, GLdouble centerz,
  196.                GLdouble upx, GLdouble upy, GLdouble upz );
  197.  
  198.  
  199. extern void gluOrtho2D( GLdouble left, GLdouble right,
  200.                 GLdouble bottom, GLdouble top );
  201.  
  202.  
  203. extern void gluPerspective( GLdouble fovy, GLdouble aspect,
  204.                 GLdouble zNear, GLdouble zFar );
  205.  
  206.  
  207. extern void gluPickMatrix( GLdouble x, GLdouble y,
  208.                GLdouble width, GLdouble height,
  209.                GLint viewport[4] );
  210.  
  211. extern int gluProject( GLdouble objx, GLdouble objy, GLdouble objz,
  212.                const GLdouble modelMatrix[16],
  213.                const GLdouble projMatrix[16],
  214.                const GLint viewport[4],
  215.                GLdouble *winx, GLdouble *winy, GLdouble *winz );
  216.  
  217. extern int gluUnProject( GLdouble winx, GLdouble winy, GLdouble winz,
  218.              const GLdouble modelMatrix[16],
  219.              const GLdouble projMatrix[16],
  220.              const GLint viewport[4],
  221.              GLdouble *objx, GLdouble *objy, GLdouble *objz );
  222.  
  223. extern const GLubyte* gluErrorString( GLUenum errorCode );
  224.  
  225.  
  226.  
  227. /*
  228.  *
  229.  * Mipmapping and image scaling
  230.  *
  231.  */
  232.  
  233. extern int gluScaleImage( GLenum format,
  234.               GLint widthin, GLint heightin,
  235.               GLenum typein, const void *datain,
  236.               GLint widthout, GLint heightout,
  237.               GLenum typeout, void *dataout );
  238.  
  239. extern int gluBuild1DMipmaps( GLenum target, GLint components,
  240.                   GLint width, GLenum format,
  241.                   GLenum type, const void *data );
  242.  
  243. extern int gluBuild2DMipmaps( GLenum target, GLint components,
  244.                   GLint width, GLint height, GLenum format,
  245.                   GLenum type, const void *data );
  246.  
  247.  
  248.  
  249. /*
  250.  *
  251.  * Quadrics
  252.  *
  253.  */
  254.  
  255. extern GLUquadricObj *gluNewQuadric( void );
  256.  
  257. extern void gluDeleteQuadric( GLUquadricObj *state );
  258.  
  259. extern void gluQuadricDrawStyle( GLUquadricObj *quadObject,
  260.                  GLUenum drawStyle );
  261.  
  262. extern void gluQuadricOrientation( GLUquadricObj *quadObject,
  263.                    GLUenum orientation );
  264.  
  265. extern void gluQuadricNormals( GLUquadricObj *quadObject, GLUenum normals );
  266.  
  267. extern void gluQuadricTexture( GLUquadricObj *quadObject,
  268.                    GLboolean textureCoords );
  269.  
  270. extern void gluQuadricCallback( GLUquadricObj *qobj,
  271.                     GLUenum which, void (*fn)() );
  272.  
  273. extern void gluCylinder( GLUquadricObj *qobj,
  274.              GLdouble baseRadius,
  275.              GLdouble topRadius,
  276.              GLdouble height,
  277.              GLint slices, GLint stacks );
  278.  
  279. extern void gluSphere( GLUquadricObj *qobj,
  280.                GLdouble radius, GLint slices, GLint stacks );
  281.  
  282. extern void gluDisk( GLUquadricObj *qobj,
  283.              GLdouble innerRadius, GLdouble outerRadius,
  284.              GLint slices, GLint loops );
  285.  
  286. extern void gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius,
  287.                 GLdouble outerRadius, GLint slices, GLint loops,
  288.                 GLdouble startAngle, GLdouble sweepAngle );
  289.  
  290.  
  291.  
  292. /*
  293.  *
  294.  * Nurbs
  295.  *
  296.  */
  297.  
  298. extern GLUnurbsObj *gluNewNurbsRenderer( void );
  299.  
  300. extern void gluDeleteNurbsRenderer( GLUnurbsObj *nobj );
  301.  
  302. extern void gluLoadSamplingMatrices( GLUnurbsObj *nobj,
  303.                      const GLfloat modelMatrix[16],
  304.                      const GLfloat projMatrix[16],
  305.                      const GLint viewport[4] );
  306.  
  307. extern void gluNurbsProperty( GLUnurbsObj *nobj, GLUenum property,
  308.                   GLfloat value );
  309.  
  310. extern void gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property,
  311.                  GLfloat *value );
  312.  
  313. extern void gluBeginCurve( GLUnurbsObj *nobj );
  314.  
  315. extern void gluEndCurve( GLUnurbsObj * nobj );
  316.  
  317. extern void gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, GLfloat *knot,
  318.                GLint stride, GLfloat *ctlarray, GLint order,
  319.                GLenum type );
  320.  
  321. extern void gluBeginSurface( GLUnurbsObj *nobj );
  322.  
  323. extern void gluEndSurface( GLUnurbsObj * nobj );
  324.  
  325. extern void gluNurbsSurface( GLUnurbsObj *nobj,
  326.                  GLint sknot_count, GLfloat *sknot,
  327.                  GLint tknot_count, GLfloat *tknot,
  328.                  GLint s_stride, GLint t_stride,
  329.                  GLfloat *ctlarray,
  330.                  GLint sorder, GLint torder,
  331.                          GLenum type );
  332.  
  333. extern void gluBeginTrim( GLUnurbsObj *nobj );
  334.  
  335. extern void gluEndTrim( GLUnurbsObj *nobj );
  336.  
  337. extern void gluPwlCurve( GLUnurbsObj *nobj, GLint count, GLfloat *array,
  338.              GLint stride, GLenum type );
  339.  
  340. extern void gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, void (*fn)() );
  341.  
  342.  
  343.  
  344. /*
  345.  *
  346.  * Polygon tesselation
  347.  *
  348.  */
  349.  
  350. extern GLUtriangulatorObj* gluNewTess( void );
  351.  
  352. extern void gluTessCallback( GLUtriangulatorObj *tobj, GLUenum which,
  353.                   void (*fn)() );
  354.  
  355. extern void gluDeleteTess( GLUtriangulatorObj *tobj );
  356.  
  357. extern void gluBeginPolygon( GLUtriangulatorObj *tobj );
  358.  
  359. extern void gluEndPolygon( GLUtriangulatorObj *tobj );
  360.  
  361. extern void gluNextContour( GLUtriangulatorObj *tobj, GLUenum type );
  362.  
  363. extern void gluTessVertex( GLUtriangulatorObj *tobj, GLdouble v[3],
  364.                void *data );
  365.  
  366.  
  367.  
  368. /*
  369.  *
  370.  * New functions in GLU 1.1
  371.  *
  372.  */
  373.  
  374. extern const GLubyte* gluGetString( GLUenum name );
  375.  
  376.  
  377.  
  378. #ifdef __cplusplus
  379. }
  380. #endif
  381.  
  382.  
  383. #endif
  384.